package com.xudow.app.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

import com.activeshare.edu.ucenter.models.cart.ShoppingCartWithCourse;

import java.util.List;

/**
 * 购物车Adapter
 *
 * @author lukecheng
 */
public class ShoppingCartAdapter extends ArrayAdapter<ShoppingCartWithCourse> {

    private Context ctx;
    private int res;
    private List<ShoppingCartWithCourse> items;

    public ShoppingCartAdapter(Context context, int resource, List<ShoppingCartWithCourse> objects) {
        super(context, resource, objects);

        this.ctx = context;
        this.res = resource;
        this.items = objects;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;

        if (null == convertView) {
            convertView = LayoutInflater.from(ctx).inflate(res, null);
            holder = new ViewHolder();

            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        return convertView;
    }

    class ViewHolder {

    }
}
